Skip to content

ci: relock uv.lock during release prepare and commit it#9

Merged
bartzbeielstein merged 1 commit into
mainfrom
ci/release-relocks-lockfile
Jun 2, 2026
Merged

ci: relock uv.lock during release prepare and commit it#9
bartzbeielstein merged 1 commit into
mainfrom
ci/release-relocks-lockfile

Conversation

@bartzbeielstein

Copy link
Copy Markdown
Contributor

Why

semantic-release bumps pyproject.toml's version but never re-locked, so uv.lock's own-package entry drifted behind every release (the lag #8 had to fix by hand).

What

In .releaserc.json:

  • Add a uv lock exec step to the prepare phase, ordered after the version sed and before the build — so the lockfile reflects the new version, and the built sdist/wheel are consistent with it.
  • Add uv.lock to the @semantic-release/git commit assets, alongside CHANGELOG.md and pyproject.toml.

Resulting prepare order: sed (bump version) → uv lockrm -rf dist && python -m build.

uv is already on PATH in the release job (via astral-sh/setup-uv), so the prepare step runs without extra setup. The relock is a single-line version change resolved from cache.

Release impact

Typed ci:, so semantic-release will not cut a new version on merge (per .releaserc.json). Takes effect on the next real (feat:/fix:) release.

🤖 Generated with Claude Code

Prevents the lockfile's own-package version from lagging behind the
pyproject version semantic-release bumps (the drift PR #8 cleaned up by
hand). Add `uv lock` to the prepare phase between the version `sed` and
the build, and include uv.lock in the @semantic-release/git assets so
each release commits the aligned lockfile.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@bartzbeielstein bartzbeielstein merged commit 0a5cb5b into main Jun 2, 2026
@bartzbeielstein bartzbeielstein deleted the ci/release-relocks-lockfile branch June 2, 2026 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant